<template>
  <div class="lis-jcsj-zkp z-col">
    <el-form :inline="true" :model="formData">
      <el-form-item label="仪器">
        <el-select v-model="formData.yqid">
          <el-option v-for="it in yqList" :key="it.id" :label="it.yqmc" :value="it.id"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="批号">
        <el-select v-model="formData.ph">
          <el-option v-for="it in phList" :key="it" :label="it" :value="it"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="水平">
        <el-select v-model="formData.zkspdm">
          <el-option
            v-for="it in zkspZd"
            :key="it.id"
            :label="it.mc"
            :value="it.id"
          ></el-option> </el-select
      ></el-form-item>
      <el-form-item>
        <el-button @click="add" type="primary">新增</el-button>
        <el-button @click="del" type="danger">删除</el-button>
        <el-button @click="save" type="primary">保存</el-button>
        <el-button @click="query" type="success">查询</el-button>
      </el-form-item>
    </el-form>
    <z-block class="z-row bottom">
      <z-block>
        <z-form-table
          ref="formTable"
          main-id="id"
          highlight-current-row
          border
          :cols="zkpTableCols"
          :data="tableData"
          @current-change="currentRow = $event"
        ></z-form-table>
      </z-block>
      <v-add class="right" :data="currentRow" @sure="query" />
    </z-block>
  </div>
</template>
<script lang="ts" setup>
import { use } from './use'
import { yqList, zkspZd, zkpTableCols } from '@utils'
import vAdd from '@coms/zkp-add/index.vue'
defineOptions({
  name: 'lis-jcsj-zkp'
})
const { formData, phList, tableData, query, del, currentRow, formTable, add, save } = use()
</script>
<style lang="scss">
.lis-jcsj-zkp {
  flex-basis: 0;
  flex-grow: 1;
  padding: 0.1rem 0.1rem 0 0.1rem;
  > .bottom {
    width: 100%;
  }
}
</style>
